import { RunnablePassthrough } from "@langchain/core/runnables";

const injector = RunnablePassthrough.assign({
  timestamp: async () => new Date().toISOString(),
  meta: async () => ({
    region: "us-east",
    requestId: "req-456",
  }),
});

// 回头上面的信息就会注入到这个对象 { query: "Vue 是什么？" }
const result = await injector.invoke({ query: "Vue 是什么？" });

console.log(result);
